package com.example.controller.handle;

import com.alibaba.dubbo.config.annotation.Reference;
import com.example.common.api.user.Test;
import com.example.common.api.user.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Auther: Aaron
 * @Date: 2018/8/20 16:09
 * @Description:
 */
@Controller
public class UserController {
    @Reference(version = "1.0.0")
    private UserService userService;

    @Reference(version = "1.0.0")
    private Test testService;

    @GetMapping("/hello.do")
    public String test(){
        String msg = userService.hello();
        System.out.println(msg);
        return msg;
    }


    @GetMapping("/login.do")
    public String login(){
        System.out.println("login index");
        return "login";
    }

    @GetMapping("/register.do")
    public String register(){
        System.out.println("login index");
        return "register";
    }



  /*  @GetMapping("/index.do")
    public String index(){
        System.out.println("login index");
        return "index";
    }
*/
    @GetMapping("/test.do")
    @ResponseBody
    public String testa(){
        System.out.println("test");
        return testService.test().toString();
    }

}
